<template>
<div class="all">
  <el-container style="height: 100vh">

    <el-aside :width="sideWidth + 'px'" style="box-shadow: 2px 0 6px rgb(0 21 41 / 35%);min-height: 100vh">
      <el-menu :default-openeds="['1', '3']" style="min-height: 100%; overflow-x: hidden"
               background-color="rgb(48, 65, 86)"
               text-color="#fff"
               active-text-color="#ffd04b"
               :collapse-transition="false"
               :collapse="isCollapse"
               router
      >
        <div style="height: 60px; line-height: 60px; text-align: center">
          <!-- <img src="../assets/logo.png" alt="" style="width: 20px; position: relative; top: 5px; right: 5px"> -->
          <b style="color: white" v-show="logoTextShow">frontvue后台管理系统</b>
        </div>


       
            <el-menu-item index="/home">
              <template slot="title">
            <i class="el-icon-message"></i>
            <span slot="title">主页</span>
          </template>
            </el-menu-item>



        <el-submenu index="2">
          <template slot="title">
            <i class="el-icon-message"></i>
            <span slot="title">用户管理</span>
          </template>
          
            <el-menu-item index="/user">用户信息管理</el-menu-item>

            <el-menu-item index="/userlevel">用户等级管理</el-menu-item>

        </el-submenu>
        <el-submenu index="3">
          <template slot="title">
            <i class="el-icon-menu"></i>
            <span slot="title">番剧管理</span>
          </template>

            <el-menu-item index="cartoonindex">番剧首页管理</el-menu-item>
        
        </el-submenu>
        <el-submenu index="4">
          <template slot="title">
            <i class="el-icon-message"></i>
            <span slot="title">动态管理</span>
          </template>
          
            <el-menu-item index="/wemedia">动态详情</el-menu-item>


        </el-submenu>
        <!-- <el-submenu index="3">
          <template slot="title">
            <i class="el-icon-setting"></i>
            <span slot="title">导航三</span>
          </template>
          <el-submenu index="3-4">
            <template slot="title">选项4</template>
            <el-menu-item index="3-4-1">选项4-1</el-menu-item>
          </el-submenu>
        </el-submenu> -->
      </el-menu>
    </el-aside>

    <el-container>
      <el-header style="font-size: 12px; border-bottom: 1px solid #ccc; line-height: 60px; display: flex">


        <div style="flex: 1; font-size: 20px">
          <span :class="collapseBtnClass" style="cursor: pointer" @click="collapse"></span>


          <el-breadcrumb separator="/" style="display:inline-block;margin-left:10px">
            <el-breadcrumb-item :to="{ path: '/home' }" >首页</el-breadcrumb-item>
            
          </el-breadcrumb>
       

        </div>
        <el-dropdown style="width: 70px; cursor: pointer">
          <span>常青</span><i class="el-icon-arrow-down" style="margin-left: 5px"></i>
          <el-dropdown-menu slot="dropdown" >
            <el-dropdown-item style="font-size: 14px; padding: 5px 0">个人信息</el-dropdown-item>
            <el-dropdown-item style="font-size: 14px; padding: 5px 0">退出</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>

      </el-header>

      <el-main>
        <router-view />
      </el-main>

    </el-container>
  </el-container>
</div>
</template>

<script>

export default {
  name: 'Home',
  data() {
    return {
      collapseBtnClass: 'el-icon-s-fold',
      isCollapse: false,
      sideWidth: 200,
      logoTextShow: true,
      headerBg: 'headerBg'
    }
  },
  methods: {
    collapse() {  // 点击收缩按钮触发
      this.isCollapse = !this.isCollapse
      if (this.isCollapse) {  // 收缩
        this.sideWidth = 64
        this.collapseBtnClass = 'el-icon-s-unfold'
        this.logoTextShow = false
      } else {   // 展开
        this.sideWidth = 200
        this.collapseBtnClass = 'el-icon-s-fold'
        this.logoTextShow = true
      }
    }
  }
}
</script>

<style>
.el-header{
  margin-top: 10px;
}
.el-aside{
  margin-left: -8px;
  margin-top: 10px;
}
.all{
  margin-top: -19px;
  text-align: left;
}
.headerBg {
  background: #eee!important;
}
</style>